<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<%@page import="com.alibaba.fastjson.JSONObject"%>
<%@page import="java.util.*"%>
<%@page import="java.io.*"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
//构造json
Map<String,Object> map = new HashMap<String, Object>();
map.put( "id", "1");
map.put("status","待考试");
map.put("period","2019学年度下学期");
map.put("college","信息学院");
map.put("course","软件详细设计");
map.put("classes","2017240206");
map.put("date","2020-5-6");
map.put("examTime","10:30");
map.put("location","WM1101");
map.put("teacher","杜瑾,李鹏");
map.put("teacherRequire","1");

List<Map> data = new ArrayList<>();
data.add(map);


JSONObject object = new JSONObject();
object.put("code",0);
object.put("msg","");
object.put("data",data);
object.put("column",false);
object.put("offset",0);

String jsonStr = JSONObject.toJSONString( object );


response.setContentType("text/json");
PrintWriter writer = response.getWriter();
writer.write( jsonStr );
writer.flush();
writer.close();
%>

</body>
</html>